<link rel="stylesheet" href="<?php echo APP_TEMPLATES_URL;?>/css/public.css" />
<script src="<?php echo APP_TEMPLATES_URL;?>/js/common.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" href="<?php echo APP_TEMPLATES_URL;?>/css/checkbix.min.css" />
<script src="<?php echo APP_TEMPLATES_URL;?>/js/checkbix.min.js" type="text/javascript" charset="utf-8"></script>
<style>
	body,
	html {
		background: #F4F4F4 !important;
	}
	.indexm {
		display: none;
	}
	.loginbnt {
		font-size: 20px;
		line-height: 50px;
		color: #000000;
		background: #f0b33e;
		float: left;
		text-align: center;
		width: 100%;
	}
	.loginbnt:active{
		background: #d8b167;
		color: #333333 !important;
	}
	.loginbnt:hover{color: #000000;}
</style>

<script type="text/javascript">
	Checkbix.init();
	$(function(){
		// 所有复选(:checkbox)框点击事件
		$("input[name=boxlist]").click(function() {
				$("input[name=boxlist]").each(function() {
					$(this).attr("checked", false);
				});
				$(this).attr("checked", true);
		});
	});

	function chargeSubmit(){
		if($('#mycheckbox2').attr('checked') || $('#mycheckbox3').attr('checked')){//alipay
			var pdr_amount = $.trim($("#pdr_amount").val());
			var fix_amountTest=/^(([1-9]\d*)|\d)(\.\d{1,2})?$/;
			if(pdr_amount==''){
				alert("请添加充值金额");
				return;
			}else if(fix_amountTest.test(pdr_amount)==false || pdr_amount<=0){
				alert("请添加充值金额为大于或者等于0.01的数字");
				return;
			}
			if($('#mycheckbox2').attr('checked')){
				if(isWeiXin()){
					alert('微信内暂不支持支付宝支付，请在其他浏览器中进行支付');
					return;
				}
				$('#payment_code').val('alipay');
			}else if($('#mycheckbox3').attr('checked')){//微信
				alert('暂不支持微信支付');
				return;
//			$('#payment_code').val('wxpay_jsapi');
			}
			$("#recharge_form").submit();
		}else{
			alert('请选择支付方式');
		}
	}
	function go_back(){
		window.location.href = 'index.php?act=predeposit&op=moneybag';
	}
	function isWeiXin() {
		var ua = window.navigator.userAgent.toLowerCase();
		if (ua.match(/MicroMessenger/i) == 'micromessenger') {
			return true;
		} else {
			return false;
		}
	}
</script>

<!-- 导航 -->
<div class="mui-bar mui-bar-nav bj">
	<button class="mui-btn mui-btn-link mui-btn-nav mui-pull-left zys">
				<img style=" max-width: 50%; vertical-align: middle;" src="<?php echo APP_TEMPLATES_URL;?>/images/back.png" onclick="go_back()" />
			</button>

	<button class="mui-btn mui-btn-link mui-btn-nav mui-pull-right" style="margin-right: 16px;    position: relative;
    z-index: 999;">
				<a href="index.php?act=predeposit&op=recharge_log">充值记录</a>
			</button>
	<h1 class="mui-title"><label style="font-size: 22px;vertical-align: middle;">充值</label></h1>
</div>
<ul class="across">
<form id="recharge_form" method="post" action="index.php">
	<input id="act" name="act" type="hidden" value="pay" />
	<input id="op" name="op" type="hidden" value="pd_order" />
	<input id="payment_code" name="payment_code" type="hidden" value="" />

	<li class="side notactive">
		<div class="countone notone">
								<label style="padding-left: 5px;">金额</label>
								<label style="text-align: right; color: #999;">
								<input name="pdr_amount" id="pdr_amount" type="text" style=" text-align:right;font-size: 14px; width: 100%;vertical-align: middle;border: 0; height: 45px;" placeholder="请输入充值金额" />
								</label>
								<label>元</label>
						</div>
	</li>
	<li class="side notactive">
		<div class="countone notone">
							<a href="javascript:();">
								<label for="mycheckbox2"><img style="    width: 25px;vertical-align: middle; margin-right: 10px;" src="<?php echo APP_TEMPLATES_URL;?>/images/z3.png" />支付宝支付</label>
								<label style="text-align: right;">
									&nbsp;<input id="mycheckbox2" type="checkbox" class="checkbix" data-shape="circled" name="boxlist" data-color="orange" data-text="" value="8">
								</label>
							</a>
						</div>
	</li>
	<li class="side notactive" style="display: none;">
		<div class="countone notone">
							<a href="javascript:();">
								<label for="mycheckbox3"><img style="    width: 25px;vertical-align: middle; margin-right: 10px;" src="<?php echo APP_TEMPLATES_URL;?>/images/z4.png" />微信支付</label>
								<label style="text-align: right;">
									&nbsp;<input id="mycheckbox3" type="checkbox" class="checkbix" data-shape="circled" name="boxlist" data-color="orange" data-text="" value="8">
								</label>
							</a>
						</div>
	</li>
</ul>
</form>

<div style="padding: 20px 15px; clear: both;">
	<table width="100%">
		<tr>
			<td>
				<a href="#" onclick="chargeSubmit()" class="loginbnt" >下一步</a>
			</td>
		</tr>		
	</table>
</div>